﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="ExamEdit.aspx.cs" Inherits="ProjectSem40701.Admin.ExamEdit" ValidateRequest="false" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register assembly="Telerik.Web.UI, Version=2009.1.311.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %>


<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
    <title>Cập nhật kỳ thi</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    
    <li><a href="ExamAdd.aspx" class="report">Thêm kỳ thi mới</a></li>
    <li><a href="UserRound.aspx">Chọn thí sinh vào vòng sau</a></li>
    <li><a href="RoundAdd.aspx">Thêm vòng thi mới</a></li>
    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">     
    <!--
        set tab active here
     -->
    <script type="text/javascript" language="javascript">
        setTab(document.getElementById("7"));
    </script>
    <!--
        end set tab active
     -->
     <div id="box">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>      
        <h3>Cập nhật kỳ thi</h3>
        <fieldset class="fieldset">
            <legend>
                Thông tin kỳ thi
            </legend>
            
            <label>Tên kỳ thi</label>
            <asp:TextBox ID="txtExamName" runat="server"></asp:TextBox>
            
            <label>Mô tả</label>
            <fckeditorv2:fckeditor ID="txtDescription" runat="server" BasePath="../fck/" 
                Height="350px" Width="550px">
            </fckeditorv2:fckeditor>
            
            <p>
                <label>Ngày bắt đầu</label>
                <asp:TextBox ID="txtStartDate" runat="server"></asp:TextBox>
                <cc1:CalendarExtender ID="txtStartDate_CalendarExtender" runat="server" 
                    Enabled="True" TargetControlID="txtStartDate">
                </cc1:CalendarExtender>
            </p>
            <p>
                <label>Giờ bắt đầu</label>
                <asp:TextBox ID="txtStartTime" runat="server"></asp:TextBox>
            </p>
            <p>
                <label>Ngày kết thúc</label>
                <asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox>
                <cc1:CalendarExtender ID="txtEndDate_CalendarExtender" runat="server" 
                    Enabled="True" TargetControlID="txtEndDate">
                </cc1:CalendarExtender>
            </p>
            
            <p>
                <label>Giờ kết thúc</label>
                <asp:TextBox ID="txtEndTime" runat="server"></asp:TextBox>
            </p>
            
            <p>
                <label>Kỳ thi sắp tới?</label>
                <asp:CheckBox ID="checkTest" runat="server"/>
            </p>
            <p>
                <label>Trạng thái</label>
                <asp:DropDownList ID="cbbStatus" runat="server" Width="120px">
                    <asp:ListItem Text="Kích hoạt" Value="1"></asp:ListItem>
                    <asp:ListItem Text="Khóa" Value="0"></asp:ListItem>
                </asp:DropDownList>
            </p>
            
        </fieldset>
     </div>
     
     <div id="box">
        <h3>Các vòng thi tương ứng</h3>
        <asp:GridView ID="grvRound" runat="server" AllowPaging="True" 
             AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="RoundID" 
             DataSourceID="ObjectDataSource1">
            <Columns>
                <asp:BoundField DataField="RoundName" HeaderText="Tên vòng thi" 
                    SortExpression="RoundName" />
                <asp:BoundField DataField="RoundStartTime" HeaderText="Thời điểm bắt đầu" 
                    SortExpression="RoundStartTime" />
                <asp:BoundField DataField="RoundMinMark" HeaderText="Điểm tối thiểu" 
                    SortExpression="RoundMinMark" />
                <asp:BoundField DataField="RoundDuration" HeaderText="Thời gian thi (phút)" 
                    SortExpression="RoundDuration" />
                <asp:TemplateField HeaderText="Trạng thái" SortExpression="RoundStatus">
                    <ItemTemplate>
                        <asp:Label ID="lblStatus" runat="server" Text='<%# Bind("RoundStatus") %>' 
                            ondatabinding="lblStatus_DataBinding"></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("RoundStatus") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:CheckBoxField DataField="RoundIsFirst" HeaderText="Vòng đầu" 
                    SortExpression="RoundIsFirst" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:HyperLink ID="linkEditRound" runat="server" 
                            NavigateUrl='<%# Eval("RoundID", "RoundEdit.aspx?rid={0}") %>'>Xem</asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
         <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
             OldValuesParameterFormatString="original_{0}" 
             SelectMethod="Get_tbl_Round_Select_All_By_ExamID" 
             TypeName="ProjectSem40701.Admin.AdminXSD.RoundTableAdapters.tbl_RoundTableAdapter">
             <SelectParameters>
                 <asp:QueryStringParameter Name="exid" QueryStringField="exid" Type="Int32" />
             </SelectParameters>
         </asp:ObjectDataSource>
     </div>
     
     <br />
     <div align="center">
        <asp:Button ID="btnUpdate" runat="server" Text="Cập nhật" CssClass="button" 
            onclick="btnUpdate_Click" />
        <cc1:ConfirmButtonExtender ID="btnUpdate_ConfirmButtonExtender" runat="server" 
            ConfirmText="Bạn có thực sự muốn cập nhật kỳ thi này?" Enabled="True" TargetControlID="btnUpdate">
        </cc1:ConfirmButtonExtender>
        
        <asp:Button ID="btnDelete" runat="server" Text="Xóa" CssClass="button" 
            onclick="btnDelete_Click" />
        <cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" 
            ConfirmText="Bạn có thực sự muốn xóa kỳ thi này?" Enabled="True" TargetControlID="btnDelete">
        </cc1:ConfirmButtonExtender>
            <asp:Button ID="btnAddRound" runat="server" Text="Thêm mới vòng thi" CssClass="button" 
                onclick="btnAddRound_Click" />
            <cc1:ConfirmButtonExtender ID="ConfirmButtonExtender2" runat="server" 
                ConfirmText="Bạn có thực sự muốn thêm mới vòng thi?" Enabled="True" TargetControlID="btnAddRound">
            </cc1:ConfirmButtonExtender>
                        
    </div>
    
     <%--Thông báo thành công hay thất bại ở đây--%>
     
    <cc1:ModalPopupExtender ID="btnUpdate_ModalPopupExtender" runat="server" 
                    DynamicServicePath="" Enabled="False" TargetControlID="btnUpdate"
                    BackgroundCssClass="modalBackground"
                    PopupControlID="pnlPopup" >
    </cc1:ModalPopupExtender>
    <cc1:ModalPopupExtender ID="btnDelete_ModalPopupExtender" runat="server" 
                    DynamicServicePath="" Enabled="False" TargetControlID="btnDelete"
                    BackgroundCssClass="modalBackground"
                    PopupControlID="pnlPopup" >
    </cc1:ModalPopupExtender>

    <asp:Panel ID="pnlPopup" runat="server" CssClass="confirm-dialog" style="display:none;">
        <div class="inner">
            <h2>
                <asp:Literal ID="ltrMessage" runat="server"></asp:Literal>
            </h2>
            <div class="base">
                <asp:Label ID="lblSuccess" runat="server" Text="" Visible="false"></asp:Label>
                <asp:Button ID="btnYes" onclick="btnYes_Click" runat="server" Text="Yes" />                            
                <asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" OnClick="btnClose_Click"
                    OnClientClick="$find('mdlPopup').hide(); return false;" />
            </div>
        </div>
    </asp:Panel>
    
</asp:Content>
